package com.weixing.mall.provider.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.provider.api.model.query.ActGoodsQuery;
import com.weixing.mall.provider.api.model.query.ErpGoodsQuery;
import com.weixing.mall.provider.api.model.vo.*;
import com.weixing.mall.provider.model.domain.Product;
import com.weixing.mall.provider.model.dto.GoodsIdProductSkuDto;
import com.weixing.mall.provider.model.query.ProductQuery;
import com.weixing.mall.provider.model.vo.GoodsConcernVo;
import com.weixing.mall.provider.model.vo.SkuVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 商品模块-货品表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-20
 */
public interface ProductMapper extends BaseMapper<Product> {
    List<ItemVo> selectByGoods(Long id);


    List<ItemVo> selectByGoodsId(Long goodsId);

    void delAllByGoods(ArrayList<Product> productList);

    Long selectByProductSkuDesp(String ProductSkuDesp);

    List<ProductEsVo> findProductEsByGoodsId(long goodsId);

    List<ActivityProductVo> findActProductVoByIds(long[] productIds);
    /*TODO后期在同步和上面的方法修改吧*/
    @Deprecated
    List<ActivityProductVo> findActProductVoByIds(Long[] productIds);
    IPage<ActivityProductVo> findActProductVo(@Param("pg") Page page, @Param("qs") ActGoodsQuery goodsQuery);

    IPage<ErpProductVo> getErpGoodsList(@Param("pg") Page page, @Param("qs") ErpGoodsQuery goodsQuery);

    List<ErpProductVo> getErpGoodsAllList(@Param("goodsFrom") Integer goodsFrom);

    void deleteByGoodsId(Long goodsId);

    @Deprecated
    ItemVo selectProduct(@Param("qs") GoodsIdProductSkuDto goodsIdProductSkuDto);

    List<SkuVo> selectSkuVoByGoodsId(Long goodsId);

    List<GoodsConcernVo> selectByIds(List<Long> productIds);

    ItemVo findProductVoByProductSn(String productSn);

    List<ActivityProductVo> findActProductVo(@Param("qs") ActGoodsQuery goodsQuery);

    IPage<ActivityProductVo> findProductVoByCreatedId(@Param("pg") Page page, Long createdById);

    /*
     *按照款号模糊查询
     */
    List<ItemVo> findProductList(String productSn);

    /*分页查询*/
    IPage<ItemVo> selectProductList(@Param("pg")Page page, @Param("qs") ProductQuery productQuery);

    /*不分页查询*/
    List<ItemVo> selectProductList(@Param("qs") ProductQuery productQuery);

    List<ItemVo> getCheckAll();

    int checkOrder(@Param("productId") Long id);

    int checkStock(@Param("productId") Long id);

    List<ItemVo> linshi();

    Integer linshi2(@Param("productId") Long id);

    GoodsPlaceVo findGoodsByProductSn(String productSn);

    List<ItemVo> selectImg();
}
